<div class="btn-group pull-right" style="margin-left: 10px;margin-right:2px;margin-bottom: 20px;">
  <button class="btn btn-primary" type="button" id="btn_detailedSearch" (click)="btn_detailedSearch()">高级查询</button>
  <button class="btn btn-primary" type="button" id="btn_typedel" (click)="delInfo()">删除</button>
</div>
<div class="col-md-12">
  <nz-table #nzTable
            [nzAjaxData]="_dataSet"
            [nzShowSizeChanger]="true"
            [nzTotal]="_total"
            [(nzPageIndex)]="_current"
            (nzPageIndexChange)="refreshData()"
            [(nzPageSize)]="_pageSize"
            (nzPageSizeChange)="refreshData(true)"
            (nzDataChange)="_displayDataChange($event)"
            [nzScroll]="{ y: 500 }">
    <ng-template #nzFixedHeader>
      <thead nz-thead>
      <tr>
        <th nz-th [nzCheckbox]="true" [nzWidth]="'5%'">
          <label *ngIf="allCheckbox==true" nz-checkbox [(ngModel)]="_allChecked" (ngModelChange)="_checkAll($event)">
          </label>
        </th>
        <th nz-th [nzWidth]="'10%'">
          <span>申请人</span>
        </th>
        <th nz-th [nzWidth]="'16%'">
          <span>开始时间</span>
        </th>
        <th nz-th [nzWidth]="'16%'">
          <span>结束时间</span>
        </th>
        <th nz-th [nzWidth]="'5%'">
          <span>状态</span>
        </th>
        <th nz-th [nzWidth]="'10%'">
          <span>操作</span>
        </th>
      </tr>
      </thead>
    </ng-template>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of nzTable.data">
      <td nz-td [nzCheckbox]="true">
        <label *ngIf="data.status!=0&&data.status!=1" nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event,data.oid)" name="{{data.oid}}">
        </label>
      </td>
      <td nz-td>{{data.applicant}}</td>
      <td nz-td>{{data.starttime}}</td>
      <td nz-td>{{data.endtime}}</td>
      <td nz-td>{{data.statusname}}</td>
      <td nz-td style="text-align: center"> <a href="#/camDetail?userId={{userId}}&psn={{data.processsn}}&comeBack=camManage">详情查看</a></td>
    </tr>
    </tbody>
  </nz-table>
</div>

<!-- 高级查询modal -->
<nz-modal id="detailedSearchModal"  [nzVisible]="isVisible" [nzTitle]="'高级查询'" [nzContent]="searchModalContent"
          (nzOnCancel)="handleCancel($event)"  [nzFooter]="false">
  <ng-template #searchModalContent>
    <div class="row">
      <div class="col-sm-12">
        <form class="form-horizontal" role="searchFile" [formGroup]="highForm">
          <div class="form-group">
            <label class="control-label col-md-4">申请人</label>
            <div class="col-md-6 col-xs-11">
              <input  readonly type="text" class="form-control" formControlName="applicantName"  id="applicantName" (dblclick)="openwin()"  (click)="clear()" data-toggle="modal"  />
              <input type="hidden"  id="applicant" name="applicant" value=""/>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-md-4">状态</label>
            <div class="col-md-6 col-xs-11">
              <select [ngModel]="status" formControlName="status" id="status" class="selectpicker form-control selector" style="height: 30px">
                <option value="-1">全部</option>
                <option *ngFor="let status of statuses" [value]="status.id">{{status.name}}</option>
              </select>
            </div>
          </div>
        </form>
      </div>
    </div>
    <div class="modal-footer">
      <button  class="btn btn-primary" type="button" id="btn_submit" (click)="detailedSearch()">确定</button>
      <button   class="btn btn-primary" type="button" (click)="handleCancel($event)">取消</button>
    </div>
  </ng-template>
</nz-modal>

<!-- 人员开窗modal -->
<nz-modal id="userModal"  [nzVisible]="userIsVisible" [nzTitle]="'单选人员开窗'" [nzContent]="userModalContent"
          [nzFooter]="false" (nzOnCancel)="userHandleCancel($event)" >
  <ng-template #userModalContent>
    <app-user-table></app-user-table>
  </ng-template>
</nz-modal>
